
export function debounce(callback, time = 400) {
	let timer
	return (...args) => {
		clearTimeout(timer)
		timer = setTimeout(() => {
			callback.call(this, ...args)
		}, time)
	}
}


export function throttle(callback, time = 100) {
	let is = true;
	return (...args) => {
		if(is) {
			is = false

			callback.call(this, ...args)

			setTimeout(() => {
					is = true
			}, time);
		}
	}
}
